<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>低值资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->          
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN PAGE LEVEL STYLES -->
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/fuelux/css/tree-metronic.css" />
	<!-- END PAGE LEVEL STYLES -->
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx }/css/custom.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->	
	<link rel="stylesheet" href="${ctx }/zTree_v3/css/demo2.css" type="text/css">
	<link rel="stylesheet" href="${ctx }/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
		.page-content{
			min-height:900px;
		}
	</style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->	
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->   
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<%@include file="../include/sidebar.jsp" %>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						资产类别管理
					</h3>					
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<hr>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->			
			<div class="row">				
				<div class="col-md-4">
					<div class="portlet purple box">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-cogs"></i>资产类别</div>
						</div>
						<div class="portlet-body" style="padding:0 0 0 0;">
							<!-- <div class="zTreeDemoBackground"> -->
							<ul id="ztree" class="ztree"></ul>
							<!-- </div> -->
						</div>
					</div>
				</div>
				<div class="col-md-8">
					<div class="portlet box blue">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-cogs"></i>资产类别设置</div>
						</div>
						<div class="portlet-body" id="wuZiLBDetail"></div>
					</div>				
				</div>
			</div>
					
			<!-- END PAGE CONTENT-->
		</div>
		<!-- END PAGE -->    
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>    
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/plugins/fuelux/js/tree.min.js"></script>  
	<!-- END PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/scripts/app.js"></script>
	<script type="text/javascript" src="${ctx }/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
	<script>
	
		var selectID="";
	
		function zTreeOnClick(event, treeId, treeNode) {
		    //alert(treeNode.tId + ", " + treeNode.name);		    
		    selectID=treeNode.id;		    
		    $.ajax({
		    	url:"${ctx}/system/getWuZiLBDetail.do?id="+selectID,
		    	type:"POST",
		    	success:function(data){
		    		$('#wuZiLBDetail').html(data);
		    	}
		    });
		    
		};
	
		var setting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				onClick: zTreeOnClick
			}
		};

		var zNodes =${result};
	
		jQuery(document).ready(function() {       
		   // initiate layout and plugins
		   App.init();
		   $('#J').addClass('active');
		   $('#J1').addClass('active');
		   $.fn.zTree.init($("#ztree"), setting, zNodes);		   
		});
		
		var shanChuBM=function(id){
			$.ajax({
				url:"${ctx}/system/shanChuLB.do?id="+id,
				type:"POST",
				success:function(data){
					window.location.reload();
				}
			});
		}
		
		var shanChuBM=function(id){
			$.ajax({
				url:"${ctx}/system/shanChuLB.do?id="+id,
				type:"POST",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="0")
						window.location.reload();
					else if(data.result=="1")
						alert("本单位有下级单位，不能删除本单位");					
				}
			});
		}
	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>